<pre style="padding:0px 10px">
    <table>
        <tr>
            <td><b>Abteilung:</b></td><td><?php echo $team->department()->name; ?></td>
            <td style="padding-left:20px"><b>Budget:</b></td>
            <td><?php 
            if(!is_null($team->budget)){
                echo number_format($team->budget, 2, ',', '.').' €';
            }
            else
            {
                echo '<span style="color:red">Nicht festgelegt!</span>'.
                     anchor('/data_management/budget/'.$team->id,
                            '<i class="icon-tag"></i>',
                             array('class' => 'action-icon', 'rel' => 'tooltip', 'title' => 'Budget festlegen')
                           );
            }
            
            ?>
            </td>
        </tr>
        <tr>
            <td><b>Teamleitung:</b></td><td><?php echo $teamleader->contactdata()->surname .','.$teamleader->contactdata()->forename; ?>(<?php echo mailto($teamleader->contactdata()->email); ?>)</td>
            <td style="padding-left:20px"><b>Kostenstelle:</b></td><td><?php echo $team->costcenter_id; ?></td>
        </tr>
    </table>
</pre>

<table class="table table-condensed table-striped">
    <tr>
        <th>#</th>
        <th>Name</th>
        <th>Vorname</th>
        <th>E-Mail</th>
        <th>Kostenstelle</th>
        <th>Standort</th>
    </tr>
    <?php foreach($members as $member): ?>
        <tr>
            <td><?php echo $member->id; ?></td>
            <td><?php echo $member->contactdata()->surname; ?></td>
            <td><?php echo $member->contactdata()->forename; ?></td>
            <td><?php echo mailto($member->contactdata()->email); ?></td>
            <td><?php echo $member->costcenter_id; ?></td>
            <td><?php echo $member->contactdata()->place()->city; ?></td>
            <td><?php echo $member->teamrole()[0]->roletype()->name; ?></td>
        </tr>
    <?php endforeach; ?>
    
</table>